﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Dimas.Framework.Common.Utils;
using Dimas.Framework.Entity;
using Dimas.Portal.BL;
using Dimas.Portal.Logic;
using Dimas.Portal.Models;
using StructureMap;

namespace Dimas.Portal.Controllers
{
    public class SampleController : BaseController
    {
        //
        // GET: /Sample/
        [AllowAnonymous]
        public ActionResult Provider(SampleModel model)
        {
            _logger.Info("start provider");
            SampleProvider provider = ObjectFactory.GetInstance<SampleProvider>();
            var request = Mapper.Map<SampleModel, SampleInfo>(model);
            var result = provider.GetWithInjection(request);
            var returnModel = Mapper.MapList<SampleInfo, SampleModel>(result);
            return View(returnModel);
        }

    }
}

